package com.qianli.cashmama.product.facade.enums;

/**
 * @program: cashmama-product
 * @description 页面位置
 * @author: frank
 * @create: 2020-02-17 16:30
 **/
public enum PagePositionEnum {

    REFUSE_PAGE(1, "REFUSE"),
    PASS_PAGE(2, "PASS"),
    AUDIT_PAGE(3, "AUDIT"),
    REPAY_SUCCESS_PAGE(4, "REPAY SUCCESS"),
    MARKET_PAGE(5, "MARKET"),
    HOME_PAGE(6, "HOME PAGE");

    PagePositionEnum(Integer posistion, String desc) {
        this.posistion = posistion;
        this.desc = desc;
    }

    private Integer posistion;
    private String desc;

    public Integer getPosistion() {
        return posistion;
    }

    public PagePositionEnum setPosistion(Integer posistion) {
        this.posistion = posistion;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public PagePositionEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static PagePositionEnum getPagePositionEnumByPosition(Integer position){
        if(position == null){
            return null;
        }
        for(PagePositionEnum pagePositionEnum : PagePositionEnum.values()){
            if(position == pagePositionEnum.getPosistion()){
                return pagePositionEnum;
            }
        }
        return null;
    }
}
